﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;

namespace Talk.Net.Server
{
	class Client
	{
		public byte[] buffer;
		public Socket socket;

		private double bytesReceived;
		private int deadCounter;

		public bool isDead()
		{
			if (deadCounter > 3)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		public Client(Socket clientSocket)
		{
			socket = clientSocket;
			buffer = new byte[8192];
		}

		public void Recieved(double bytes)
		{
			if (bytes > 0)
			{
				bytesReceived = bytesReceived + bytes;
				deadCounter = 0; 
			}
			else
			{
				deadCounter++;
			}
		}
	}
}
